<?php
class Core_Model_BaseModel implements Core_Model_IBase
{
	protected $dbAdapter = null;
	
	public function __construct() {
		$this->_initDBAdapter();
	}
	
	private function _initDBAdapter()
	{
		$this->dbAdapter = new Core_Common_DBTable();
		$this->dbAdapter->setOptions( array( Core_Common_DBTable::NAME => $this->_name ) );
	}

	/*	
	protected $rawData = array();
	
	public function __call( $method, $arg = array() )
	{
		$return = null;
		$prefix = mb_substr( $method, 0, 3 );
		//$fieldName = mb_strtolower( mb_substr( $method , 3 , 1 ) ) . mb_substr( $method, 4 );
		$fieldName = lcfirst( mb_substr( $method, 3 ) );
		$fieldName = preg_replace(  '/([A-Z])/', '_$1', $fieldName );
		$fieldName = strtolower( $fieldName );
		switch ( $prefix )
		{
			case 'get':
			default:
				if ( isset( $this->rawData[$fieldName] ) ) {
					$return = $this->rawData[$fieldName];
				}
				break;
		}
		return $return;
	}
	
	public function __construct( $data = null )
	{
		echo '111'; print_r($data);
		if ( !empty( $data ) ) {
			$this->rawData = (array)$data;
		}
				echo '222'; print_r($this->rawData);
		parent::__construct();
	}
	
	public static function getInstance( $id = null )
	{
		$className = get_called_class();
		return new $className();
	}
*/	
}